package com.paas.exception;

import com.paas.enums.BizCodeEnum;
import lombok.Data;


/**
 * @author pangjs
 * @version 0.1
 * @date 2021/4/12 1:29 下午
 * @description
 */

@Data
public class BizException extends RuntimeException {

    private int code;
    private String msg;

    public BizException(int code, String msg){
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public BizException(BizCodeEnum bizCodeEnum){
        super(bizCodeEnum.getMessage());
        this.code = bizCodeEnum.getCode();
        this.msg = bizCodeEnum.getMessage();
    }


}
